package com.tyj.movie.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.tyj.movie.entity.Movie;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tyj.movie.vo.CinemasMovieVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author tyj
 * @since 2021-06-28
 */
public interface MovieMapper extends BaseMapper<Movie> {

    List<Movie> queryHotShowMovie();

    List<Movie> queryComingMovies();

    List<Movie> queryHotMovies();

    Integer queryHotShowMovieNum();

    Integer queryComingMoviesNum();

    void updateWatchNumberAddByMovieId(Long id);

    void updateWatchNumberReduceByMovieId(Long id);

    List<Movie> queryCommentLevelAndMovieId();

    IPage<Movie> conditionQueryMovie(
            @Param("page") IPage page,
            @Param("movieShow") String movieShow,
            @Param("movieType") String movieType,
            @Param("movieArea") String movieArea,
            @Param("movieSort") String movieSort
    );

    void batchUpdateMovieGrade(@Param("movieList") List<Movie> movieList);

    CinemasMovieVo queryCinemasMovieVo(Long movieId);
}
